Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.VisualBasic

Namespace GSALib.Constants
    ''' <summary>
    ''' Class provides access for searching in public, secure, or both contents supported by GSA
    ''' <para>Author Albert Ghukasyan</para>    
    ''' </summary>
    Public NotInheritable Class Access
#Region "Variables"

        ''' <summary>
        ''' returns PUBLIC results
        ''' </summary>
        Public Shared [PUBLIC] As New Access("p"c)

        ''' <summary>
        ''' returns SECURE results
        ''' </summary>
        Public Shared SECURE As New Access("s"c)

        ''' <summary>
        ''' returns ALL results
        ''' </summary>
        Public Shared ALL As New Access("a"c)

        Private value As Char

#End Region

#Region "Constructor"

        Private Sub New(ByVal value As Char)
            Me.value = value
        End Sub

#End Region

#Region "Methods"

        Public Function hashCode() As Integer
            Return Val(value)
        End Function

        Public Overrides Function equals(ByVal o As Object) As Boolean
            Dim retval As Boolean = False
            If o IsNot Nothing AndAlso TypeOf o Is Access Then
                Dim other As Access = DirectCast(o, Access)
                retval = other.value = Me.value
            End If
            Return retval
        End Function

        Public Function getValue() As Char
            Return value
        End Function

#End Region

    End Class
End Namespace
